package org.java.dao.DaoImpl;

import org.java.entity.Artist;
import org.java.util.JDBCUtil;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;

import java.util.List;

public class ArtArtistDao {

    private JdbcTemplate jdbcTemplate=new JdbcTemplate(JDBCUtil.getDataSource());

//获取artist表中的数据，产生Artist集合

    public List<Artist> getList(){
        String sql="SELECT * FROM art_store_artist";
        return jdbcTemplate.query(sql,new BeanPropertyRowMapper<>(Artist.class));
    }
    public List<Artist> getArtist() {
        String sql="SELECT a_headp,a_truename,a_intro FROM art_store_artist";
        return jdbcTemplate.query(sql,new BeanPropertyRowMapper<>(Artist.class));
    }
}
